import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login', //登录界面
      component: () => import('@/components/common/login'),
      meta: {
        requireAuth: false
    }
    },
    {
      path: '/index', //教师主页
      component: () => import('@/components/admin/index'),
      children: [
        {
          path: '/', //首页默认路由
          component: () => import('@/components/common/hello'),
          meta: {
            requireAuth: true
        }
        },
        {
          path:'/grade', //学生成绩
          component: () => import('@/components/charts/grade'),
          meta: {
            requireAuth: true
        }
        },
        {
          path: '/selectExamToPart', //学生分数段
          component: () => import('@/components/teacher/selectExamToPart'),
          meta: {
            requireAuth: true
        }
        },
        {
          path: '/scorePart',
          component: () => import('@/components/charts/scorePart'),
          meta: {
            requireAuth: true
        }
        },
        {
          path: '/allStudentsGrade', //所有学生成绩统计
          component: () => import('@/components/teacher/allStudentsGrade'),
          meta: {
            requireAuth: true
        }
        },
        {
          path: '/examDescription', //考试管理功能描述
          component: () => import('@/components/teacher/examDescription'),
          meta: {
            requireAuth: true
        }
        },
        {
          path: '/selectExam', //查询所有考试
          component: () => import('@/components/teacher/selectExam'),
          meta: {
            requireAuth: true
        }
        },
        {
          path: '/addExam', //添加考试
          component: () => import('@/components/teacher/addExam'),
          meta: {
            requireAuth: true
        }
        },
        {
          path: '/answerDescription', //题库管理功能介绍
          component: ()=> import('@/components/teacher/answerDescription'),
          meta: {
            requireAuth: true
        }
        },
        {
          path: '/selectAnswer', //查询所有题库
          component: () => import('@/components/teacher/selectAnswer'),
          meta: {
            requireAuth: true
        }
        
        },
        {
          path: '/addQuestionOne', //增加一个题目
          name: "addQuestionOne", 
          component: () => import('@/components/teacher/addQuestionOne'),
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/addExamOne', //增加考试
          name: "addExamOne", 
          component: () => import('@/components/teacher/addExamOne'),
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/addAnswer', //增加题库主界面
          component: () => import('@/components/teacher/addAnswer'),
          meta: {
            requireAuth: true
        }
        },
        {
          path: '/addAnswerChildren', //点击试卷跳转到添加题库页面
          component: () => import('@/components/teacher/addAnswerChildren'),
          meta: {
            requireAuth: true
        }
        },
       
        {
          path: '/studentsManage', //学生管理界面
          component: () => import('@/components/teacher/studentManage'),
          meta: {
            requireAuth: true
        }
        },
        // {
        //   path: '/studentInfo', //学生详细信息
        //   component: () => import('@/components/teacher/studentInfo'),
        //   meta: {
        //     requireAuth: true
        // }
        // },
         //新增试卷
         {
          path: '/addPaper',
          component: () => import ('@/components/teacher/addPaper'),
          meta: {
            requireAuth: true
        }
        },
        {
          path: '/selectExamPaperDetails', //查看试卷详情
          name: "selectExamPaperDetails", 
          component: () => import('@/components/teacher/selectExamPaperDetails'),
          meta: {
            requireAuth: true
        }},
        {
          path: '/lookOrCorrect', //查看详情页面
          name: "lookOrCorrect", 
          component: () => import('@/components/teacher/lookOrCorrect'),
          meta: {
            requireAuth: true
        }},
        {
          path: '/correctInterface', //查看批改页面
          name: "correctInterface", 
          component: () => import('@/components/teacher/correctInterface'),
          meta: {
            requireAuth: true
        }},
        {
          path: '/teacherManage',
          component: () => import('@/components/admin/tacherManage'),
          meta: {
            requireAuth: true
        }
        },
        {
          path: '/addTeacher',
          component: () => import ('@/components/admin/addTeacher'),
          meta: {
            requireAuth: true
        }
        },
        // 添加试题
        {
          path: '/addQuesstion',
          component: () => import ('@/components/teacher/addQuesstion'),
          meta: {
            requireAuth: true
        }
        },
        //试卷分类
        {
          path: '/papercategory',
          component: () => import ('@/components/teacher/paperCategory'),
          meta: {
            requireAuth: true
        }
        }
       
      ]
    },
    {
      path: '/student',
      component: () => import('@/components/student/index'),
      //component: () => import('@/components/student/answer'),
      children: [
        {path:"/",component: ()=> import('@/components/student/myExam'), meta: {requireAuth: true}},
        {path:'/startExam', component: () => import('@/components/student/startExam'),meta: {requireAuth: true}},
        {path: '/manager', component: () => import('@/components/student/manager'),meta: {requireAuth: true}},
        {path: '/examMsg', component: () => import('@/components/student/examMsg'),meta: {requireAuth: true}},
        {path: '/message', component: () => import('@/components/student/message'),meta: {requireAuth: true}},
        {path: '/studentScore', component: () => import("@/components/student/answerScore"),meta: {requireAuth: true}},
        {path: '/scoreTable', component: () => import("@/components/student/scoreTable"),meta: {requireAuth: true}}
      ]
    },
    {path: '/answer',component: () => import('@/components/student/answer')}
  ]
})
